const { Menu } = require('electron');
const menu_tpl = [
    {
        label: "文件",
        submenu: [
            {label:"新建"},
            {label:"打开"},
            {label:"保存"},
        ]
    },
    {
        label: "编辑",
        submenu: [
            {label:"撤销"},
            {label:"重做"},
            {label:"清空"},
        ]
    },
];
const my_topmenu = Menu.buildFromTemplate(menu_tpl);
Menu.setApplicationMenu(my_topmenu);